feat(review): add an opt-in draft-PR close policy to stop bot-review farming - #6454
Merged
Conversation
…farming
Contributors were opening PRs directly as draft (or converting to draft
immediately after opening) to get labels, AI review, and slop-gate feedback
from the bot without ever being subject to a real one-shot disposition --
distinct from the existing reviewEvasionProtection family, which only
enforces after a review has already run against the PR's current head, or
on the 2nd+ ready<->draft conversion.
Adds draftPrClosePolicy ("off" | "close", off by default) as a new
RepositorySettings field (migration + schema + resolver + openapi, mirroring
reviewEvasionProtection's exact wiring) and a new maybeCloseDraftPr guard in
src/queue/review-evasion.ts, closely modeled on the existing draft-conversion
review-evasion guard but firing on ANY draft (opened directly as one, or
converted to one) rather than requiring a prior review pass. Deliberately
does not record a moderation strike -- this is a blanket repo policy against
ordinary GitHub draft usage, not a detected abuse pattern. Enabled for this
repo's own dogfood config (.loopover.yml + the bundled fallback manifest).
Companion to the CI-side fix (#6448, merged) that stops the heavy job
fan-out from running on draft PRs in the first place.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6454 +/- ##
==========================================
- Coverage 95.59% 95.56% -0.03%
==========================================
Files 589 589
Lines 47025 47057 +32
Branches 14951 14967 +16
==========================================
+ Hits 44952 44972 +20
- Misses 1291 1294 +3
- Partials 782 791 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Bundle ReportChanges will increase total bundle size by 898 bytes (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: loopover-uiAssets Changed:
|
This was referenced Jul 16, 2026
glorydavid03023
pushed a commit
to glorydavid03023/gittensory
that referenced
this pull request
Jul 16, 2026
PR JSONbored#6454 (draft-pr-close-policy) and PR JSONbored#6467 (screenshot-table-gate-head-sha-correlation) both grabbed migration number 0156, merging 23 minutes apart without seeing each other's number. db:migrations:check now fails on main for every PR. Renumber the later-merged one (JSONbored#6467) to the next free number.
JSONbored
added a commit
that referenced
this pull request
Jul 16, 2026
0156_draft_pr_close_policy.sql (#6454) and 0156_pull_request_screenshot_table_ presence_satisfied.sql (a same-day, independently-merged PR) both grabbed migration number 0156 relative to the same origin/main base and merged without a collision being caught. Both have already been applied to production D1 under their current filenames (confirmed via d1_migrations) — renaming either now would make wrangler try to RE-APPLY it, and both are bare ALTER TABLE ADD COLUMN statements SQLite can't guard with IF NOT EXISTS, so the re-apply would error and break the next deploy. Grandfather 0156 in KNOWN_MIGRATION_DUPLICATES, matching the exact precedent already set by 0015/0017/0074/0090 for the same "already-shipped, can't-be-renumbered" reason.
JSONbored
added a commit
that referenced
this pull request
Jul 16, 2026
… autonomy config-as-code PR #773's autonomy config-as-code change (fix(settings): give loopover its own autonomy config-as-code, merged as PR #6468) replaced the same settings: block section in both .loopover.yml and its bundled fallback manifest, silently dropping this repo's own draftPrClosePolicy: close line in the process — the feature (#6454, merged) has been fully live in code since, just disabled for loopover's own repo because nothing enabled it. Re-add draftPrClosePolicy: close alongside (not replacing) the autonomy: block, in both the committed .loopover.yml and its bundled byte-identical twin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
reviewEvasionProtectionfamily (draft-dodge / self-close / draft-conversion / repeated-cycling), which only enforces after a review has already run against the PR's current head, or on the 2nd+ ready↔draft conversion.draftPrClosePolicy("off"|"close", off by default — opt-in, unlikereviewEvasionProtection's default-close) as a newRepositorySettingsfield: migration + schema + resolver + openapi, mirroringreviewEvasionProtection's exact wiring.maybeCloseDraftPrguard insrc/queue/review-evasion.ts, closely modeled on the existing draft-conversion review-evasion guard, but firing on any draft (opened directly as one, or converted to one) rather than requiring a prior review pass. Only fires when the PR's own author took the draft action — a maintainer converting someone else's PR is unaffected..loopover.yml+ the bundled fallback manifest), since this is the repo experiencing the abuse.Test plan
test/unit/queue-lifecycle-guards.test.tscovering: off-by-default, closes on direct-open-as-draft, closes on conversion, no moderation strike,autoCloseExemptLoginshonored, write-collaborator exemption, third-party-converter exemption.loopover.yml↔ bundled fallback, RepositorySettings ↔ openapi schema, migration numbering)npm run test:ci) green